# -*- coding: utf-8 -*-
# __author__ = "Zok"
# Date: 2018/6/9

import platform
import os
import sys
import time
from termcolor import colored

# 路径配置
if platform.system() == 'Windows':
    BASE_DIR = '\\'.join(os.path.abspath(os.path.dirname(__file__)).split('\\')[:-1])  # 去掉尾部的目录取允许总目录
else:
    BASE_DIR = '/'.join(os.path.abspath(os.path.dirname(__file__)).split('/')[:-1])

sys.path.insert(0, BASE_DIR)
print('当前系统：%s  目录：%s' % (platform.system(), BASE_DIR))
DATA_PATH = os.path.join(BASE_DIR, 'db')


# 格式化取时间
def time_format():
    return time.strftime('%Y-%m-%d %H:%M:%S', time.localtime())


# 优化输出字体颜色，简洁代码 直接Print.颜色就可以调用
class Print:
    @staticmethod
    def red(data):
        print(colored(data, 'red'))

    @staticmethod
    def yellow(data):
        print(colored(data, 'yellow'))

    @staticmethod
    def green(data):
        print(colored(data, 'green'))

    @staticmethod
    def blue(data):
        print(colored(data, 'blue'))

    @staticmethod
    def magenta(data):
        print(colored(data, 'magenta'))



